﻿@inject IBlogService Service
@inject IClientUriGenerator UrlGenerator

@if (Count is not null)
{
    <span class="itemdisplay">
        <span class="mdi mdi-eye">@Count.Value</span>
    </span>
}

@code {
    [Parameter]
    public Post Data { get; set; }

    private long? Count { get; set; }

    protected override async Task OnParametersSetAsync()
    {
        Count = await Service.StatisticService?.Count(UrlGenerator, Data);
    }
}
